home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261c.zoo / objects / zone.h < prev   
Encoding:
C/C++ Source or Header  |  1994-11-19  |  1.2 KB  |  32 lines

  1. #ifndef __zone_h_OBJECTS_INCLUDE
  2. #define __zone_h_OBJECTS_INCLUDE
  3.  
  4. #include <stddef.h>
  5.  
  6. typedef struct _NXZone 
  7. {
  8.   void *(*realloc)(struct _NXZone *zonep, void *ptr, size_t size);
  9.   void *(*malloc)(struct _NXZone *zonep, size_t size);
  10.   void (*free)(struct _NXZone *zonep, void *ptr);
  11.   void (*destroy)(struct _NXZone *zonep);
  12. } NXZone;
  13.  
  14. #define NX_NOZONE  ((NXZone *)0)
  15. #define NXZoneMalloc(zonep, size) ((*(zonep)->malloc)(zonep, size))
  16. #define NXZoneRealloc(zonep, ptr, size) ((*(zonep)->realloc)(zonep, ptr, size))
  17. #define NXZoneFree(zonep, ptr) ((*(zonep)->free)(zonep, ptr))
  18. #define NXDestroyZone(zonep) ((*(zonep)->destroy)(zonep))
  19.  
  20. extern NXZone *NXDefaultMallocZone(void);
  21. extern NXZone *NXCreateZone(size_t startSize, size_t granularity, int canFree);
  22. extern NXZone *NXCreateChildZone(NXZone *parentZone, size_t startSize, 
  23.                  size_t granularity, int canFree);
  24. extern void NXMergeZone(NXZone *zonep);
  25. extern void *NXZoneCalloc(NXZone *zonep, size_t numElems, size_t byteSize);
  26. extern NXZone *NXZoneFromPtr(void *ptr);
  27. extern void NXZonePtrInfo(void *ptr);
  28. extern void NXNameZone(NXZone *z, const char *name);
  29. extern int NXMallocCheck(void);
  30.  
  31. #endif /* __zone_h_OBJECTS_INCLUDE */
  32.